﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Guwave.MonitorDevice.WPFClientApp.Model
{
    public class MonitorDeviceModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        /// <summary>
        /// 读取设备间隔时间
        /// </summary>
        private string _readDeviceIntervalTime;
        public string ReadDeviceIntervalTime
        {
            get { return _readDeviceIntervalTime; }
            set
            {
                _readDeviceIntervalTime = value;
                OnPropertyChanged(nameof(ReadDeviceIntervalTime));
            }
        }

        /// <summary>
        /// 读取文件间隔时间
        /// </summary>
        private string _readFileIntervalTime;
        public string ReadFileIntervalTime
        {
            get { return _readFileIntervalTime; }
            set
            {
                _readFileIntervalTime = value;
                OnPropertyChanged(nameof(ReadFileIntervalTime));
            }
        }

        /// <summary>
        /// 文件路径
        /// </summary>
        private string _filePath;
        public string FilePath
        {
            get { return _filePath; }
            set
            {
                _filePath = value;
                OnPropertyChanged(nameof(FilePath));
            }
        }

        /// <summary>
        /// 接口地址
        /// </summary>
        private string _infanceArrdess;
        public string InfanceArrdess
        {
            get { return _infanceArrdess; }
            set
            {
                _infanceArrdess = value;
                OnPropertyChanged(nameof(InfanceArrdess));
            }
        }

        /// <summary>
        /// 端口号集合
        /// </summary>
        private ObservableCollection<string> _points;
        public ObservableCollection<string> Points
        {
            get { return _points; }
            set
            {
                _points = value;
                OnPropertyChanged(nameof(Points));
            }
        }

        /// <summary>
        /// 默认端口号
        /// </summary>
        private string _defaultPoint;
        public string DefaultPoint
        {
            get { return _defaultPoint; }
            set
            {
                _defaultPoint = value;
                OnPropertyChanged(nameof(DefaultPoint));
            }
        }

        /// <summary>
        ///波特率集合
        /// </summary>
        private ObservableCollection<string> _readBuffers;
        public ObservableCollection<string> ReadBuffers
        {
            get { return _readBuffers; }
            set
            {
                _readBuffers = value;
                OnPropertyChanged(nameof(ReadBuffers));
            }
        }

        /// <summary>
        /// 默认波特率
        /// </summary>
        private string _defaultReadBuffer;
        public string DefaultReadBuffer
        {
            get { return _defaultReadBuffer; }
            set
            {
                _defaultReadBuffer = value;
                OnPropertyChanged(nameof(DefaultPoint));
            }
        }
    }
}
